﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace HD_CoCaNgua
{
    public enum SPRITE_STATE
    {
        VISIBLE,
        ATTACT,
        MOVING,
        HIDE
    }
    public abstract class CSprite
    {
        //Location of the sprite
        private Rectangle _spriteRectangle;
        private Rectangle _boundingRectangle;

        private SPRITE_STATE _state;

        public SPRITE_STATE State
        {
            get { return _state; }
            set { _state = value; }
        }

        public CSprite()
        {


        }

        public CSprite(Rectangle rectSprite, Rectangle rectBounding)
        {
            _spriteRectangle = rectSprite;
            _boundingRectangle = rectBounding;
        }

        public Rectangle SpriteRectangle
        {
            get { return _spriteRectangle; }
            set { _spriteRectangle = value; }
        }
        public Rectangle BoundingRectangle
        {
            get { return _boundingRectangle; }
            set { _boundingRectangle = value; }
        }

        public bool CheckCollision(CSprite anotherSprite)
        {
            if (Rectangle.Intersect(_boundingRectangle, anotherSprite._boundingRectangle) != null)
            {
                return true;
            }
            return false;
            
        }

        protected static Random rand = new Random(1);

        public abstract void Draw(Graphics g);

        public abstract void Update();

        public abstract void Reset();


    }
}
